package us.kg.kotoriforest.springmvc.restful.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import us.kg.kotoriforest.springmvc.restful.validator.GenderValidator;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Kotori rotroutine@163.com
 * @since 2025/2/8
 */
@Documented
@Constraint(validatedBy = {GenderValidator.class}) // 由校验器完成校验功能
@Target(FIELD)
@Retention(RUNTIME)
public @interface Gender {
    String message() default "{us.kg.kotoriforest.springmvc.restful.annotation.Gender.message}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
